<template>
  <el-select
    v-model="selectValue"
    filterable
    :placeholder="placeholder"
    style="width: 150px"
    @change="changeValue"
  >
    <el-option
      v-for="item in selectArray"
      :key="item"
      :label="item"
      :value="item"
    />
  </el-select>
</template>

<script>
  export default {
    name:'item',
    props:{
      valueType:String,//类型是什么
      selectArray:Array, //遍历的数组又是什么
      placeholder:String
    },
    data(){
      return {
        isLoading:false,
        selectValue:''
      }
    },
    watch:{
      'selectArray':{
        handler(){
           this.selectValue = ''
           
        }
      }
    },
    methods:{
      changeValue(){
        this.$emit('editValue',{type:this.valueType,value:this.selectValue})
      }
    },
    
  }
</script>

<style lang="scss" scoped>

</style>